< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03103400.xhp

(section: public) (bookmark: bm_id3153311)
Public statement

Public ステートメント

Public Statement [Runtime]
Public ステートメント [実行時](hd_id3153311.1)

Dimensions a variable or an array at the module level (that is, not within a subroutine or function), so that the variable and the array are valid in all libraries and modules.
変数や配列を (有効範囲を関数やサブルーチン内に限定するのではなく) モジュールレベルで定義し、すべてのライブラリやモジュールを通じて利用できるようにします。(par_id3150669.2)

(/section: public)

Syntax:
構文:(hd_id3150772.3)

Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]]
Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]](par_id3155341.4)

Example:
例:(hd_id3145315.5)

Public iPublicVar As Integer
Public iPublicVar As Integer(par_id3156024.6)

Sub ExamplePublic
Sub ExamplePublic(par_id3153896.8)

iPublicVar = iPublicVar + 1
iPublicVar = iPublicVar + 1(par_id3149656.9)

MsgBox iPublicVar
MsgBox iPublicVar(par_id3150359.10)

End sub
End sub(par_id3154365.11)


< Prev / Next >